package com.jlpay.openapi.demo.fund.deferred;

import com.jlpay.open.jlpay.sdk.java.model.BaseResponse;
import com.jlpay.open.jlpay.sdk.java.model.fund.deferred.request.DeferredActivationOpenRequest;
import com.jlpay.open.jlpay.sdk.java.utils.json.JsonUtils;
import com.jlpay.openapi.demo.JlpayOpenApiService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author chenjunhong
 * @since 2024/12/20
 */
public class DeferredActivationOpenService {

    private static final Logger LOGGER = LoggerFactory.getLogger(DeferredActivationOpenService.class);

    public static void main(String[] args) {
        DeferredActivationOpenRequest deferredActivationOpenRequest = buildDeferredActivationOpenRequest();
        BaseResponse deferredActivationOpenResponse = JlpayOpenApiService.openMerchService()
                .post(deferredActivationOpenRequest, BaseResponse.class);
        LOGGER.info("开通资金管控响应:{}", JsonUtils.toString(deferredActivationOpenResponse));
    }

    private static DeferredActivationOpenRequest buildDeferredActivationOpenRequest() {
        DeferredActivationOpenRequest deferredActivationOpenRequest = new DeferredActivationOpenRequest();
        deferredActivationOpenRequest.setMerchNo("849551860110001");
        deferredActivationOpenRequest.setAgreementPic("region-ali-oss://jlpay-test/managefile/2024/02/28/1709081506952_af4f376e39d64abeb5dfb8a0c6db0da7.png");
        return deferredActivationOpenRequest;
    }
}
